package Q.test04162.Service;

import Q.test04162.Mapper.UserInfo;
import Q.test04162.Mapper.UserInfoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserService {

    @Autowired
    private UserInfoMapper user;

    public UserInfo query(String name, String password){
        List<UserInfo> userInfos = user.queryByName(name, password);
        if(userInfos!=null && userInfos.size()>0){
            return userInfos.get(0);
        }else return null;
    }

}
